from tortoise import fields, models

class TimestampMixin:
    """时间戳混合类，提供创建时间和更新时间字段"""
    created_at = fields.DatetimeField(auto_now_add=True, description="创建时间")
    updated_at = fields.DatetimeField(auto_now=True, description="更新时间")

class BaseModel(models.Model, TimestampMixin):
    """基础模型类"""
    id = fields.IntField(pk=True, description="ID")

    class Meta:
        abstract = True